home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 676-700 / 699 / mungwall / mungwall.doc < prev    next >
Text File  |  1995-03-18  |  6KB  |  132 lines

  1. 30-Jun-92 Mungwall 37.52 doc.
  2.  
  3. Mungwall munges memory and watches for illegal FreeMem's.
  4. Mungwall is especially useful in combination with Enforcer.
  5. Output is either serial or parallel (mungwall.par).
  6.  
  7. Since 37.49 MungWall, NAMETAG option tags each allocation with the name
  8. of the allocator.  The new "MUNGLIST" program examines used memory areas
  9. for mungwall tag info, and outputs a list of who owns the various
  10. pieces of allocated memory, their sizes, etc.  If you have used the
  11. NAMETAG option of MungWall, this list will include the name of the
  12. task or command that allocated the memory.  Note that certain
  13. allocations belonging to your program may be displayed as belonging
  14. to another task (such as the task of a disk device that you
  15. locked a file on or accessed).
  16.  
  17. Mungwall 37.51 adds an AvailMem wedge which reduces reported available
  18. memory by the size which Mungwall will add to any allocation.  It also
  19. correct a problem which had caused the NAMETAG option to crash on a
  20. 68000.
  21.  
  22. Mungwall 37.52 fixes Enforcer hits in task name comparisons and adds
  23. better A6 handling when calling the real memory functions.
  24.  
  25. Memory munging:
  26.  
  27.  - Except when Enforcer is running, location 0 is set to $C0DEDBAD, i.e.
  28.    programs referencing location zero will not f.e. find a null string.
  29.  
  30.  - On startup all free memory is munged with $ABADCAFE. If this number
  31.    shows up, someone is referencing memory in the free list.
  32.  
  33.  - Except when MEMF_CLEAR is set, memory is pre-munged on allocation with
  34.    $DEADFOOD. When this is used in an Enforcer report, the caller is
  35.    allocating memory and doesn't initialize it before using it. Note that
  36.    only memory which has a cookie attached will be pre-munged.
  37.  
  38.  - Memory is filled with $DEADBEEF before it is freed, encouraging
  39.    programs reusing free'ed memory to crash.
  40.  
  41. Memory watching:
  42.  
  43. Mungwall places a magic cookie before the memory allocation.
  44. Along with a wall of bytes on either side of the allocation to keep an
  45. eye on the memory just before or after the allocation. If the
  46. memory wall is trashed, mungwall complains and shows the damaged area.
  47. If memory is trashed so bad that the cookie is completely gone, Mungwall
  48. will not consider it a walled memory allocation and lets it go. Changes
  49. are you'll be corrupting the memory list and/or overwriting other memory
  50. allocation and crash soon after that. If a mungwall hit occurs, memory
  51. will not be munged or free'ed, to give you a change to look at what was
  52. written there.
  53.  
  54. Both null pointer FreeMem()'s and null sized Alloc/FreeMem()'s trigger
  55. mungwall. Mungwall also gets upset when a memoryblock is free'ed with a
  56. size different from the one used for allocating the memoryblock, and will
  57. say so. The integrity of the walls will be tested according to the size
  58. specified on allocation time, but will not be free'ed.
  59.  
  60. Pointers passed to FreeMem() will be rejected if they are non-longword
  61. alligned. Thus possible catching bogus pointers otherwise left untouched
  62. by mungwall.
  63.  
  64. Unless a specific task(s) is watched and that task leaves before mungwall
  65. does, mungwall will always lose some memory.
  66.  
  67. NOTES:
  68.  
  69. Other debugging tools which SetFunction() AllocMem() and/or
  70. FreeMem() and JSR to what they think is the old memory routine,
  71. should be run BEFORE mungwall. Mungwall needs to know the returnaddress
  72. of the initial caller. Running other debugging tools after mungwall
  73. will result in false reports about layers.library and invalid
  74. mungwall reports about the caller. The 'scratcher' for example must
  75. be run before mungwall, 'memoration' can be run afterwards, since it
  76. JMP's.
  77.  
  78. When mungwall is being stopped, the walls around the original allocations
  79. which are not free'ed at that point, will never get free'ed, only the block
  80. within. Thus causing memory fragmentation and memoryloss.
  81.  
  82. Memory allocations larger than 3 gigabytes will not be marked by mungwall.
  83.  
  84.  
  85.  
  86. MUNGWALL [UPDATE] [[TASK name][WAIT]] [SNOOP] [NOSNOOP] [NOWAIT] [INFO]
  87.          [MEGASTACK] [NAMETAG] [PRESIZE n] [POSTSIZE n] [FILLCHAR 0xXX]
  88.  
  89. TASK name   - Watch only the task(s), or all but the task(s) specified
  90.               with 'name'. Multiple tasknames are indicated by placing
  91.               a '|' between the names. If the names are preceeded by an
  92.               exclamation mark, all tasks except the ones indicated are
  93.               tracked. ALL is a reserved name, indicating all tasks
  94.               should be tracked. Default ALL.
  95.  
  96. PRESIZE     - Size of wall before memory allocation in bytes. Minimum 4,
  97.               maximum 64. Default 32.
  98.  
  99. POSTSIZE    - Size of wall after memory allocation in bytes. Minimum 4,
  100.               maximum 64. The actual number of bytes after the allocation
  101.               may vary slightly, since it's upped to the nearest longword.
  102.               Default 32.
  103.  
  104. FILLCHAR n  - Character to build the memory wall with. Can be indicated
  105.               both hexadecimal and decimal. Default 0xBB.
  106.  
  107. SNOOP       - Produce snoop compatible output. No snoop output is given
  108.               for illegal FreeMem's. Default OFF. Layers AllocMem's and
  109.               FreeMem's are never snooped. SNOOP is particulary useful
  110.               in combination with TASK. Snoop output can be filtered
  111.               with 'snoopstrip' to find the origin of memory loss.
  112.  
  113. WAIT        - Halt task causing a hit and wait for Ctrl-C. Make sure you
  114.             - can issue a break to the task. WAIT can be used without
  115.               specifying a specific taskname to watch. Default OFF.
  116.  
  117. INFO        - Show configuration information.
  118.  
  119. MEGASTACK   - Show 32 longwords of the stack whenever a hit/snoop occurs
  120.  
  121. NAMETAG     - Tag each allocation with allocating task or command's name
  122.  
  123. UPDATE      - Indicates an already running mungwall task should be up-
  124.               dated with new parameters. Presize, postsize and fillchar
  125.               can never be updated.
  126.  
  127. The following are extra updating parameters.
  128.  
  129. NOSNOOP     - Turn snooping off.
  130.  
  131. NOWAIT      - No longer halt a task in case of an error.
  132.